﻿@{
    ViewBag.Title = "EditUser";
}

<script src="/Scripts/User.js"></script>
<script>
    $(function () {
        var userId = $("#Id").val();
        doAjaxHtml("Admin", "EditUserEditGroup_GetNewGroup", { UserId: userId }, function (data) { }, "#AddNewGroup");
    })
</script>
@using wne.models
@model wne.models.UserModel
    
@Html.HiddenFor(m => m.Id)
<div class="hero-unit row" style="padding: 10px 0px 10px 30px; margin: 10px 0px 10px 0px">
    <h3>Редактирование групп пользователя</h3>
    <h4>@Model.Surname @Model.FirstName @Model.SecondName</h4>
</div>

    <div id="UserGroups">
        @foreach (var q in Model.UserGroups)
        {
            <p id="@q.Id">
            <span class='lead'>@q.Name</span>
            <i class='icon-remove-sign' onclick="UserDelGroup('@q.Id','@q.Name');" ></i>
            </p>
        }
    </div>
<div id="AddNewGroup" class="input-prepend">
        <select id="NewGroupsList">
        <option>Добавить группу</option>
        </select>
    <button type="button" class="btn">
        <i class="icon-plus"></i>
    </button>
</div>
    
<p>
    <button class="btn" onclick="location.href = '/Admin/EditUser?id=@Model.Id'">Назад</button>
</p>